package com.pay.ioopos.fragment;

import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.google.zxing.BarcodeFormat;
import com.pay.ioopos.DataFactory;
import com.pay.ioopos.R;

import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;


public class DomainListFragment extends AbstractFragment {
    public static final String[] domains = {"https://open.pay.ioopos.com", /* 有多域名请在这里添加 , */ "扫码配置"};

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_domain_list, container, false);
        LinearLayout layout = view.findViewById(R.id.domain_list);
        for (int i = 0; i < domains.length; i++) {
            TextView domainView = new TextView(getContext());
            domainView.setTextSize(30);
            domainView.setText( (i + 1) + "." + domains[i]);
            layout.addView(domainView);
        }
        TextView curDomainView = view.findViewById(R.id.cur_comain);
        curDomainView.setText(DataFactory.getDataStore().getServerUrl());
        return view;
    }



}
